﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Knihkupectvo.SpocitejCenu
{
    abstract class Komponenta
    {
        public abstract decimal getCena();
        public abstract string getNazev();
    }

    class Objednavka : Komponenta
    {
        private const decimal constSleva = 0.9M;
        private decimal CelkovaCena { get; private set; }
        private bool Sleva { get; private set; }

        public Objednavka(decimal celkovaCena, bool sleva)
        {
            this.CelkovaCena = celkovaCena;
            this.Sleva = sleva;        
        }

        public override decimal getCena()
        {
            if (Sleva)
            {
                return CelkovaCena * constSleva;
            }
            else
            {
                return CelkovaCena;
            }
        }

        public override string getNazev()
        {
            return "Objednavka";
        }
    }
}
